{extend name="platform/base" /}
{block name="resources"/}
<style>
</style>

{/block}
 {block name="main"}
 <section class="panel panel-default">
 <header class="panel-heading font-bold"> 运营模式 </header>
 <div class="panel-body">
 	<form class="form-horizontal">
	<div class="col-sm-9">

	</div>
	
	<div class="line line-dashed line-lg pull-in"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label">网站访问模式</label>
		<div class="col-sm-4">
			<select id="visit_pattern" name="visit_pattern"class="form-control m-b">
				<option value="0" {if condition="$website['url_type'] eq 0"} selected="selected"{/if}>兼容模式</option>
				<option value="1" {if condition="$website['url_type'] eq 1"} selected="selected"{/if}>pathinfo模式</option>
			</select>
		</div>
	</div>
	<div class="line line-dashed line-lg pull-in"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label">网站风格</label>
		<div class="col-sm-4">
			<select id="style_id" name="account" class="form-control m-b">
				{volist name="style_list_admin" id="v"}
					<option value="{$v['style_id']}" {if condition="$website['style_id_pc'] eq $v['style_id']"} selected{/if}>{$v['style_name']}</option>
				{/volist}
			</select>
		</div>
	</div>
	<div class="line line-dashed line-lg pull-in"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label">PC端商城运营状态</label>
		<div class="col-md-4">
			  <label for="navigationtype1" class="radio-label"><input type="radio" value="1" name="navigationtype" id="navigationtype1" {if condition="$website.web_status eq 1"}checked{/if}/>开启</label>
		      <label for="navigationtype2" class="radio-label"><input type="radio" value="2" name="navigationtype" id="navigationtype2" {if condition="$website.web_status eq 2"}checked{/if}/>关闭</label>
 	     	  <label for="navigationtype3" class="radio-label"><input type="radio" value="3" name="navigationtype" id="navigationtype3" {if condition="$website.wap_status eq 3"}checked{/if}/>关闭后访问WAP端</label>
 	     </div>
 	     <p class="col-sm-4" style="width:100%;margin-left: 16.66%;margin-top: 10px;color: #BBB;">暂时将站点关闭，其他人无法访问，但不影响管理员访问</p>
	</div>
	<div class="line line-dashed line-lg pull-in"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label">WAP端商城运营状态</label>
		 <div class="col-md-4">
			  <label for="waptype1" class="radio-label"><input type="radio" value="1" name="waptype" id="waptype1" {if condition="$website.wap_status eq 1"}checked{/if}/>开启</label>
	      	  <label for="waptype2" class="radio-label"><input type="radio" value="2" name="waptype" id="waptype2" {if condition="$website.wap_status eq 2"}checked{/if}/>关闭</label>
 	     	  <label for="waptype3" class="radio-label"><input type="radio" value="3" name="waptype" id="waptype3" {if condition="$website.wap_status eq 3"}checked{/if}/>关闭后访问PC端</label>
 	     </div>
 	     <p class="col-sm-4" style="width:100%;margin-left: 16.66%;margin-top: 10px;color: #BBB;">暂时将站点关闭，其他人无法访问，但不影响管理员访问</p>
	</div>
	<div class="line line-dashed line-lg pull-in"></div>
	<div class="form-group">
		<label class="col-sm-2 control-label">网站关闭原因</label>
		 <div class="col-md-4">
			<textarea name="store_zy" rows="2" id="close_reason" class="textarea w400" style="width:350px;height:100px;">{$website.close_reason}</textarea>
		    <p class="hint" style="color:#BBB;margin-top:10px;">请填写站点关闭原因，将在前台显示</p>
		</div>
	</div>
	<div class="line line-dashed line-lg pull-in"></div>
		<div class="form-group">
			<div class="col-sm-4 col-sm-offset-2">
				<a href="javascript:void(0);" onclick="setConfigAjax()" class="btn btn-primary">保存</a>
			</div>
		</div>
	</form>
</div>
</section>
{/block} 
{block name="script"}
<link rel="stylesheet" type="text/css" href="__ROOT__/public/admin/css/plugin/jquery.searchableSelect.css">
<script src="__ROOT__/public/admin/js/plugin/jquery.searchableSelect.js"></script>
<script src="__STATIC__/js/BootstrapMenu.min.js"></script>
<script type="text/javascript">
function setConfigAjax() {
	var visit_pattern = $("#visit_pattern").val();
	var web_style_admin = $("#style_id").val();
	var web_status = $("input[name='navigationtype']:checked").val();
	var wap_status = $("input[name='waptype']:checked").val();
	var close_reason = $("#close_reason").val();
	
	 $.ajax({
			type:"post",
			url:"{:__URL('PLATFORM_MAIN/config/visitConfig')}",
			data:{
				'web_style_admin':web_style_admin,
				'web_status' : web_status,
				'wap_status' : wap_status,
				'close_reason' : close_reason,
				'visit_pattern' : visit_pattern
			},
			async:true,
			success:function (data) {
				if (data["code"] > 0) {
					showMessage('success', data["message"],"{:__URL('PLATFORM_MAIN/config/webconfig')}");
				}else{
					showMessage('error', data["message"]);
				}	
			}
		}); 
	}

</script>
{/block}
